let str1 = 'Hello TS';
const str2 = 'Hello TS';

const str3 = '我是常量，我不能被改变';

const obj: { name: 'jack' } = { name: 'jack' };

const arr: [] = [];

// 字面量类型场景
type Direction = 'up' | 'down' | 'left' | 'right';

const fun = (dir: Direction): void => {
  console.log(dir);
};

// 调用改变方向函数
fun('down');

window.addEventListener('resize', (e) => console.log(e));

// 枚举实现四个方向
enum Direction2 {
  Up,
  Down,
  Left,
  Right,
}

const fun2 = (dir: Direction2): void => {
  console.log(dir);
};

// 调用 fun2
fun2(Direction2.Down);

export {};
